length 的作用
- 返回字符串的字节长度
- 注意:使用 utf8 编码字符集时,一个汉字是 3 个字节,一个数字或字母是一个字节
length 的语法格式
length(str)
小栗子
select length("帅哥"); # 6
select length(12345); # 5
select length("2020-05"); # 7
length(str)
select length("帅哥"); # 6
select length(12345); # 5
select length("2020-05"); # 7